package com.zw.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.zw.dao.UserMapper;
import com.zw.entity.User;
import com.zw.entity.UserExample;
import com.zw.service.UserService;

@Service
public class UserServiceImpl implements UserService{
	@Autowired
	private UserMapper userMapper;

	@Cacheable(value="userCache")
	@Override
	public User selectUser(User u) {
		UserExample ue=new UserExample();
		ue.or().andNameEqualTo(u.getName()).andPasswordEqualTo(u.getPassword());
		User ruser=userMapper.selectUserByExample(ue);
		return ruser;
	}

}
